package com.atguigu.day17.treeset;

public class Cat implements Comparable<Cat>{
    String name;
    int age;
    double weight;

    public Cat(String name, int age, double weight) {
        this.name = name;
        this.age = age;
        this.weight = weight;
    }

    @Override
    public String toString() {
        return "Cat{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", weight=" + weight +
                '}';
    }

    @Override
    public int compareTo(Cat o) {
        return Integer.compare(this.age,o.age);
    }
}
